@echo off
setlocal

set drv=%~d2
set pth=%~npx2
for /f "tokens=1,2 delims==>" %%i in ('subst') do (
if /i %%~di == %drv% (
tf.exe %1 %%j%pth%
exit /B
)
)
echo no mapping found
endlocal